/*
-----------------------------------------------------------------------------
This source file is part of Labor3D
(Labor 3D Graphics Engine)

Copyright (c) 2009-2020 Rock Mao
* creator : Rock Mao
* created : 2009-5-4   14:52
* filename: LaborDynLibMgr.h
-----------------------------------------------------------------------------
*/

#ifndef __LABORDYNLIBMGR_H__
#define __LABORDYNLIBMGR_H__
#include "../LaborCoreDef.h"
#include "../Common/LaborSingleton.h"
#include <map>

NAMESPACE_LABOR3D_BEGIN
#pragma  warning(disable : 4251)
class CLDynLib;
class LABORCORE_API CLDynLibMgr : public CLSingleton<CLDynLibMgr>
{
protected:
	typedef std::map<CLString, CLDynLib*> DynLibList;
	DynLibList m_LibList;
public:
	CLDynLibMgr();
	~CLDynLibMgr();

	/** Loads the passed library.
	@param
	filename The name of the library. The extension can be omitted
	*/
	CLDynLib* load(const CLString& filename);

	/** Unloads the passed library.
	@param
	filename The name of the library. The extension can be omitted
	*/
	void unload(CLDynLib* lib);
};

inline CLDynLibMgr* GetDynLibMgr() { return CLDynLibMgr::getSingletonPtr(); }

NAMESPACE_LABOR3D_END

#endif